import moment from 'moment';
export default {
	data() {
		return {
			loading: false,
			timeRanges: [],
			dateConfig: {
				editable: false,
				clearable: false,
				type: 'daterange',
				rangeSeparator: '至',
				style: 'width: 280px;',
				endPlaceholder: '结束日期',
				startPlaceholder: '开始日期',
				class: 'date_picker_wrapper',
				valueFormat: 'yyyy-MM-dd HH:mm:ss',
				pickerOptions: this.formatPickerOptions()
			},
			queryData: {
				page: 1,
				limit: 15
			},
			tableData: [],
		}
	},
	methods: {
		formatPickerOptions() {
			let startTime = null;
			return {
				onPick(data) {
					if (data.minDate && !data.maxDate) {
						startTime = moment(data.minDate);
					}
					if (data.maxDate) {
						startTime = null;
					}
				},
				disabledDate(time) {
					return !!startTime && startTime.isSame(moment(time), 'day');
				}
			};
		}
	}
}